package us.gaaoc.framework.webapp.backingbeans.agent.reports;

import java.util.ArrayList;
import java.util.List;

import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.transaction.annotation.Transactional;

import us.gaaoc.framework.model.util.DocumentsCountByType;
import us.gaaoc.framework.webapp.backingbeans.BaseBackingBean;


public class DocumentDataTableBean  extends BaseBackingBean{
	 
	/** Generated Serial Version UID */
	private static final long serialVersionUID = 6552124334526880035L;
	private List<DocumentsCountByType> numberOfDocumentsByType = new ArrayList<DocumentsCountByType>();
	   private DataModel dataTableList;
		private int numberOfDocuments;
		
	public DocumentDataTableBean(){
		this.numberOfDocumentsByType = this.getModelFacade().countDocumentsByType();
		this.dataTableList = new ListDataModel();
		this.dataTableList.setWrappedData(this.numberOfDocumentsByType);
	}
	public String back() {
		return "back";
	}

	public int getNumberOfDocuments() {
		numberOfDocuments=this.getModelFacade().countDocuments();
	//	System.out.println("NumberOfDocuments="+numberOfDocuments);
		return numberOfDocuments;
	}
	public void setNumberOfDocuments(int numberOfDocuments) {
		this.numberOfDocuments = numberOfDocuments;
		
	}
	public DataModel getDataTableList() {
		return dataTableList;
	}
	public void setDataTableList(DataModel dataTableList) {
		this.dataTableList = dataTableList;
	}
	
	public  List<DocumentsCountByType> getNumberOfDocumentsByType() {
		return numberOfDocumentsByType;
	}
	public void setNumberOfDocumentsByType(List<DocumentsCountByType> numberOfDocumentsByType) {
		this.numberOfDocumentsByType = numberOfDocumentsByType;
		
	}
}
